<%@page import="com.lrf.freeshipping.bean.PageBean"%>
<%@page import="com.lrf.freeshipping.tool.LogTool"%>
<%@page import="com.lrf.freeshipping.jdbc.SQLConstant"%>
<%@page import="com.lrf.freeshipping.jdbc.JDBCOption"%>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html lang="en">
  <head>
    <meta charset="utf-8">
    <title>商品管理系统</title>
    <meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="">
    
     <link rel="shortcut icon" type="image/x-icon" href="assets/image/favicon.ico" />
    
    <link rel="stylesheet" type="text/css" href="css/bootstrap.css">
    <link rel="stylesheet" type="text/css" href="css/theme.css">
    <link rel="stylesheet" type="text/css" href="css/font-awesome.css">
    
    <script src="js/jquery-1.8.1.min.js" type="text/javascript"></script>

    <!-- Demo page code -->
    
    <style type="text/css">
        #line-chart {
            height:300px;
            width:800px;
            margin: 0px auto;
            margin-top: 1em;
        }
        .brand { font-family: georgia, serif; }
        .brand .first {
            color: #ccc;
            font-style: italic;
        }
        .brand .second {
            color: #fff;
            font-weight: bold;
        }
    </style>
</head>

  <body> 
    <!-- 引入头 -->
    <jsp:include page="head.jsp"/>

    <div class="container-fluid">
        
        <div class="row-fluid">
            <!-- 引入左菜单栏 -->
            <jsp:include page="left-menu.jsp" flush="true"></jsp:include>
        <div class="span9">
            <script type="text/javascript" src="js/jquery.jqplot.min.js"></script>
<script type="text/javascript" charset="utf-8" src="js/graphDemo.js"></script>


 <p class="block-heading" data-toggle="collapse" data-target="#chart-container">商品统计
    <%  
       PageBean pageBean = (PageBean)session.getAttribute("pageBean");
    %>
    <label class="block-heading" data-toggle="collapse" data-target="#chart-container" style="float:right" >总数：<%=pageBean.getProductNumber()%>件</label>
 </p>

<div class="row-fluid"></div>


<div class="row-fluid">
    <div class="block">
        <p class="block-heading" data-toggle="collapse" data-target="#chart-container">
		<table class="table">
              <thead>
                <tr>
                  <th>商品种类</th>
                  <th>上架数量</th>
                  <th>已下架数量</th>
                </tr>
              </thead>
              <tbody>
              <%  
                 String []tags = {"Lastest","Women's Fashion","Men's Fashion","Accessories",
            		  "Jewelry&Watches","Beauty&Health","Beauty&Health","Wallet&Bags","Gadgets",
            		  "Underwear","Baby&KIds","Home Decor"}; 
                 for(int i= 0;i<tags.length;i++){
                	int onsale=0,upsale=0,tagTotal=0;
                	List list  = JDBCOption.query(SQLConstant.queryProductByType1, "%"+tags[i]+"%");
                	   for(int j=0;j<list.size();j++){
                		   Map map = new HashMap();
                		   map = (Map)list.get(j);
                		   if((Boolean)map.get("valid")) onsale++;
                		   else upsale++;               		   
                	   }
                	   tagTotal = onsale+upsale;
              %>
               <tr>
                  <td> <a href="product.jsp?tag=<%=tags[i]%>"><%=tags[i]%></a></td>
                  <td><%=onsale %></td>
                  <td><%=upsale %></td>
                  <td><%=onsale+upsale %></td>
               </tr>
              <%}%>		
              </tbody> 
        </table>		
		</div>
</div>
</div>   
</div> 
</div>
   <footer>
        <hr>
        
        <p class="pull-right">develop from <a href="#" title="iwenkeji" target="_blank">iwenkeji</a></p>
        
        
        <p>&copy; 2015 <a href="#">跨进电商</a></p>
    </footer>
    

    

    <!-- Le javascript
    ================================================== -->
    <!-- Placed at the end of the document so the pages load faster -->
    <script src="js/bootstrap.js"></script>

  </body>
</html>